package routers

import (
	"github.com/gin-gonic/gin"
	v1 "learnGo/internal/routers/v1"
	v2 "learnGo/internal/routers/v2"
)

func NewRouter() (r *gin.Engine) {
	r = gin.New()
	r.Use(gin.Logger())
	r.Use(gin.Recovery())
	api := r.Group("/api")
	r1 := api.Group("/v1")
	v1.AddRouter(r1)
	r2 := api.Group("/v2")
	v2.AddRouter(r2)
	return
}
